import http from "../assets/js/http";
//
/**
 *  @parms resquest 请求地址 例如：http://197.82.15.15:8088/request/...
 *  @param '/testIp'代表vue-cil中config，index.js中配置的代理
 */
let resquest, IsUserModule;
//servePlatform == 1 测试服  servePlatform ==2 电信(盈江)
// servePlatform ==3 正式 servePlatform ==4 包头 servePlatform ==5 巴中

let servePlatform = 3;
if (servePlatform == 1) {
  // //测试
  resquest = "http://tforestentranceapi.ctchain.cn/";
  IsUserModule = true;
  // 华贸
  // resquest = "https://carbonentranceapi.cqhmlykj.com/";
  // IsUserModule = true;
} else if (servePlatform == 2) {
  // 电信(盈江)
  resquest = "https://carbonentranceapi.zhongyingtanhui.com/";
  IsUserModule = false;
} else if (servePlatform == 3) {
  // 正式
  resquest = "https://forestentranceapi.zlink.group/";
  IsUserModule = true;
} else if (servePlatform == 4) {
  // 包头
  // resquest = "https://carbonentranceapi.baotanhui.com/";
  resquest = "http://carbonentranceapi.btlcth.org.cn/";
  IsUserModule = false;
} else if (servePlatform == 5) {
  // 巴中
  resquest = "https://carbonentranceapi.bzevt.com/";
  IsUserModule = false;
}
// get请求
export default {
  getListAPI(api, params) {
    return http.get(`${resquest}` + api, params);
  },
  postFormAPI(api, params, type) {
    return http.post(`${resquest}` + api, params, type);
  },
  getUrl() {
    return resquest;
  },
  getIsUserModule() {
    return IsUserModule;
  },
  servePlatform() {
    return servePlatform
  },
  getStatic(api, params) {
    return http.get(api, params);
  },
};
